<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>体重变化记录</title>
  <link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
  <link rel="stylesheet" href="../css/reset.css" />
  <link rel="stylesheet" href="../css/index.css" />
<style>
  body{

}
</style>

</head>
<body>
    <div id="app">
        <div id="head">
          <img src="../img/logo.png" alt="">
        </div>
        <div id="main"></div>

        <div id="button">
            <el-row class ="operation">
                <el-button type="primary" @click="queryFormVisible = true">查询体重</el-button>
                <el-button type="success"  @click="addFormVisible = true">添加体重</el-button>
                <el-button type="warning"  @click="switchUser">切换用户</el-button>
              </el-row>
        </div>




        <!-- 查询表单 -->
        <el-dialog title="查询日期" :visible.sync="queryFormVisible">
            <el-form :model="queryForm">
              <el-form-item label="日期" >
                <el-date-picker
                
                v-model="queryForm.dates"
                type="daterange"
                unlink-panels
                range-separator="至"
                start-placeholder="开始日期"
                end-placeholder="结束日期"
                :picker-options="pickerOptions">
              </el-date-picker>
              </el-form-item>

            </el-form>
            <div slot="footer" class="dialog-footer">
              <el-button @click="queryFormVisible = false">取 消</el-button>
              <el-button type="primary" @click="query">确 定</el-button>
            </div>
        </el-dialog>


        <!-- 添加表单 -->
        <el-dialog title="添加体重" :visible.sync="addFormVisible">
            <el-form :model="addForm"  >
                <el-form-item label="日期" >
                    <el-date-picker
                    v-model="addForm.date"
                    type="date"
                    placeholder="选择日期">
                  </el-date-picker>
                </el-form-item>

                <el-form-item label="时间" >
                    <el-select v-model="addForm.time" placeholder="选择时间">
                      <el-option label="早上" value="morning"></el-option>
                      <el-option label="晚上" value="evening"></el-option>
                    </el-select>
                  </el-form-item>
    
                <el-form-item label="体重" >
                    <el-input style="display: inline;width: 325px;" type="number" clearable="true"  v-model="addForm.weight" placeholder="体重(斤)"></el-input>
                </el-form-item>

            </el-form>



            <div slot="footer" class="dialog-footer">
                <el-button @click="addFormVisible = false">取 消</el-button>
                <el-button type="primary" @click="add">确 定</el-button>
            </div>
        </el-dialog>

    </div>


  <script src="https://cdn.jsdelivr.net/npm/echarts@5.3.3/dist/echarts.min.js"></script>
  <script src="../js/axios-0.18.0.js"></script>
  <script src="../js/vue.js"></script>
  <script src="https://unpkg.com/element-ui/lib/index.js"></script>
  <script src="../js/index.js"></script>

</body>
</html>